package com.xiaoxi.adaptermode.adapter;

import com.xiaoxi.adaptermode.adaptee.SocketAdaptee;
import com.xiaoxi.adaptermode.target.SocketTarget;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.adaptermode.adapter
 * @ClassName SocketObjectAdapter
 * @Description TODO
 * @Date 2023/3/7 15:19
 * @Version 1.0
 */
public class SocketObjectAdapter implements SocketTarget {

    private SocketAdaptee socketAdaptee;

    public SocketObjectAdapter(SocketAdaptee socketAdaptee) {
        this.socketAdaptee = socketAdaptee;
    }

    @Override
    public void commonTwoHoleSocket() {
        this.socketAdaptee.commonThreeHoleSocket();
        System.out.println("-----------------开始转换------------------");
        System.out.println("适配器支持：二孔插座");
    }

    @Override
    public void roundSocket() {
        this.socketAdaptee.commonThreeHoleSocket();
        System.out.println("-----------------开始转换------------------");
        System.out.println("适配器支持：圆孔插座");
    }
}
